package zgs;

import java.lang.reflect.Constructor;

/**
 * 通过方法对象获取方法的常见信息
 */
public class ReflectDemo6 {
    public static void main(String[] args) throws Exception {

        Class cls = Class.forName("zgs.Person");

        Constructor c = cls.getConstructor();
        Object obj = c.newInstance();
        System.out.println(obj);

        Constructor c1 = cls.getConstructor(String.class, int.class);
        Object obj1 = c1.newInstance("王五", 33);
        System.out.println(obj1);






    }
}
